package graph;


/*
 * @authors: Clayson Celes and Andrey Bicalho
 * 05 out 2011
 */
public class Edge {
	
	private double cost;
	
	private Vertex node1;
	
	private Vertex node2;
	
	public Edge(Vertex node1, Vertex node2){
		this(node1, node2, 1);
	}
	
	public Edge(Vertex node1, Vertex node2, double cost){
		this.node1 = node1;
		this.node2 = node2;
		this.cost = cost;
	}
	
	public void setCost(double cost){
		this.cost = cost;
	}
	
	public double getCost(){
		return this.cost;
	}
	
	public void setNode1(Vertex node1){
		this.node1 = node1;
	}
	
	public Vertex getNode1(){
		return node1;
	}
	
	public void setNode2(Vertex node2){
		this.node2 = node2;
	}
	
	public Vertex getNode2(){
		return node2;
	}
	
	@Override
	public String toString(){
		String myString = "\n(node1: "+ node1+ ", node2: "+ node2 + ") = " + cost;
		return myString;
	}
}
